const  Koa = require('koa');
const  Router = require('koa-router');
const {verifyLogin,verifyPermission} = require("../middlewares/auth.middleware");
const {getComment, getComments, createComment,reply, updateComment, deleteComment} = require("../controllers/comment.controller");
const commentRoute = new Router({
    prefix: '/comment'
});

commentRoute.post('/',verifyLogin,createComment);
commentRoute.post('/:commentId/reply',verifyLogin,reply);
//修改评论
commentRoute.patch('/:commentId',verifyLogin,verifyPermission,updateComment);
//删除评论
commentRoute.delete('/:commentId',verifyLogin,verifyPermission,deleteComment);
//获取评论列表
commentRoute.get('/',getComments);
module.exports = commentRoute;

